package com.zygh.policeasset.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zygh.policeasset.mapper.DailyAssetMapper;
import com.zygh.policeasset.pojo.DailyAsset;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
/* loaded from: police-asset-2.0-0.0.1-SNAPSHOT.jar:BOOT-INF/classes/com/zygh/policeasset/service/DailyAssetsService.class */
public class DailyAssetsService {
    @Autowired
    DailyAssetMapper dailyAssetMapper;

    public int deleteById(Integer id) {
        return this.dailyAssetMapper.deleteById(id);
    }

    public int deleteBybuildNum(String buildNum) {
        return this.dailyAssetMapper.deleteBybuildNum(buildNum);
    }

    public int add(DailyAsset dailyAsset) {
        return this.dailyAssetMapper.add(dailyAsset);
    }

    public int update(DailyAsset dailyAsset) {
        return this.dailyAssetMapper.update(dailyAsset);
    }

    public DailyAsset findAllByid(Integer id) {
        return this.dailyAssetMapper.findAllByid(id);
    }

    public PageInfo findBydailyProjectId(int pageNum, int pageSize, Integer dailyProjectId, String category, String basicsName, Integer assetsClassificationId) {
        PageHelper.startPage(pageNum, pageSize);
        return new PageInfo<>(this.dailyAssetMapper.findBydailyProjectId(dailyProjectId, category, basicsName, assetsClassificationId));
    }

    public List<DailyAsset> findAllBybuildNum(String buildNum) {
        return this.dailyAssetMapper.findAllBybuildNum(buildNum);
    }

    public Integer updateStartProvisionDate(String startProvisionDate, Integer id) {
        return this.dailyAssetMapper.updateStartProvisionDate(startProvisionDate, id);
    }

    public Integer updassetsClassificationId(String ids, Integer assetsClassificationId, Integer assetsClassificationPid) {
        Integer count = 0;
        for (String str : ids.split(",")) {
            this.dailyAssetMapper.updateassetsClassification(Integer.valueOf(Integer.parseInt(str)), assetsClassificationId, assetsClassificationPid);
            count = Integer.valueOf(count.intValue() + 1);
        }
        return count;
    }

    public Integer findByBuildNum(Integer id) {
        return this.dailyAssetMapper.findByBuildNum(id);
    }
}